library(gstat)
predict.gstat.par<-function(obj,s){
    library(parallel)
    ### if we choose FORK cluster, we dont need export data to cluster.
    cl<-makeCluster(getOption('cl.cores', detectCores()*0.8),type='FORK')
    # clusterEvalQ(cl, {
    #     ## set up each worker.  Could also use clusterExport()
    #     library(gstat)
    # })
    # clusterExport(cl, c("obj","newdata"),envir=environment())
    idx <-clusterSplit(cl, 1: dim(s)[1])
    ssplt <- lapply(idx, function(i) s[i,])
    df7 = parSapply(cl,ssplt,FUN=predict,object=obj) 
    stopCluster(cl)
    do.call("rbind", df7)
}
